package com.bird.singleevent;

import org.springframework.context.ApplicationListener;

/**
 * @data 2023/4/7 22:34
 * @author: bird
 * @description: 事件监听者
 * ApplicationListener:是spring容器的事件监听器 里面的泛型是要监听的哪个事件对象
 */

public class ListenerEventCustom implements ApplicationListener<MyEventObject> {


    /**
     * 监听到了事件，并处理事件对象
     * @param myEventObject
     */
    @Override
    public void onApplicationEvent(MyEventObject myEventObject) {
        System.out.println("监听到的事件: "+ myEventObject);
    }
}
